<template>
  <div>
    <el-collapse value="common">
      <el-collapse-item title="公共配置" name="common">
        <el-form :model="widget.UI.data" label-width="80px" size="mini" class="pad-lft-rgt-10">
          <el-row :gutter="10">
            <el-col :span="24">
              <el-form-item label="最小值">
                <el-input-number v-model="widget.UI.data.minLimit" controls-position="right" placeholder="请设置最小值"
                                 class="width-100">
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="最大值">
                <el-input-number v-model="widget.UI.data.maxLimit" controls-position="right" placeholder="请设置最大值"
                                 class="width-100">
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="步长">
                <el-input-number v-model="widget.UI.data.step" controls-position="right" placeholder="请设置步长"
                                 class="width-100">
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24" v-if="widget.UI.data.iconStyle">
              <el-form-item label="加减大小">
                <el-input-number v-model="widget.UI.data.iconStyle.size" controls-position="right" placeholder="请设置加减大小"
                                 class="width-100">
                </el-input-number>
              </el-form-item>
            </el-col>
            <el-col :span="24" v-if="widget.UI.data.iconStyle">
              <el-form-item label="加减颜色">
                <PopoverColor :colorValue="widget.UI.data.iconStyle.color">
                  <CustomColorPicker v-model="widget.UI.data.iconStyle.color" show-alpha></CustomColorPicker>
                </PopoverColor>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
  import {WidgetInputNumber} from "@/modules/IDE/widget/atom/widgetInputNumber";
  import CustomColorPicker from '@/components/IDE/colorPicker/Color.vue';
  import PopoverColor from '@/components/IDE/colorPicker/Popovers.vue';
  export default {
    name: 'InputNumberSpec',
    components: {
      CustomColorPicker, PopoverColor
    },
    props: {
      widget: {
        type: WidgetInputNumber,
        default: () => {
          return {};
        }
      }
    },
    computed: {
      state() {
        return this.widget.getCurrentState();
      },
    },
    data() {
      return {}
    },
  };
</script>

<style scoped></style>
